<?php
	require_once("../includes/barramenu.php") ;
	require_once("../includes/gridView.php")  ;
	$oBarra = new BarraMenu() 				  ;
	$Grid1  = new GridView()				  ;
?>
<!DOCTYPE html>
<html lang="es">
<head>
<title>Mantenimiento kardex</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../../includes/css/jquery-ui-notarios.css" rel="stylesheet" type="text/css"/>
<link href="../includes/scrollableFixedHeaderTable.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" href="../../tcal.css" />
<!--<link rel="stylesheet" href="../../css/uniform.default.css" type="text/css" media="screen">-->

<script src="../../includes/js/jquery-1.9.0.js"></script>
<script src="../../includes/js/jquery-ui-notarios.js"></script>
<!--<script src="../../jquery.uniform.js" type="text/javascript" charset="utf-8"></script>-->	  

<script type="text/javascript" src="../../tcal.js"></script> 
<script type="text/javascript" src="../includes/jquery.scrollableFixedHeaderTable.js"></script>
<script language="JavaScript" type="text/javascript" src="../../ajax2.js"></script>
<script language="JavaScript" type="text/javascript" src="../../includes/script1.js"></script>
<script language="JavaScript" type="text/javascript" src="../includes/ext_script1.js"></script>
<style type="text/css">
<!--
#title_client{
background-color: #ffffff;
border: 4px solid #264965;  
-moz-border-radius: 13px;
-webkit-border-radius: 13px;
border-radius: 13px;
-moz-box-shadow: 0px 0px 5px #000000;
-webkit-box-shadow: 0px 0px 5px #000000;
box-shadow: 0px 0px 5px #000000;	
}
div.frmclientes
{ 
background-color: #ffffff;
border: 4px solid #264965;  
-moz-border-radius: 13px;
-webkit-border-radius: 13px;
border-radius: 13px;
-moz-box-shadow: 0px 0px 5px #000000;
-webkit-box-shadow: 0px 0px 5px #000000;
box-shadow: 0px 0px 5px #000000;
width:820px; height:750px;
}

.submenutitu {
	font-family: Calibri;
	font-size: 18px;
	font-style: italic;
	color:#FF9900;
}
#frmclientes{
	padding-bottom:0px;
	margin-bottom:0px;
	}
.GridPar
{
	border:0px;
	border-spacing:0px;
	border-collapse:0px;
	font:Arial, Helvetica, sans-serif;
	font-size:11px;
	color:#300;
	cursor:pointer;
	background-color:#FFFFFF;
}
.GridImp
{
	border:0px;
	border-spacing:0px;
	border-collapse:0px;
	font:Arial, Helvetica, sans-serif;
	font-size:11px;
	color:#300;
	cursor:pointer;
	background-color:#E8E8E8;
}
.GridCab
{
	font-size:17px;
	
	
}
<!-- end table -->

.line {color: #FFFFFF}
.titulosprincipales {	font-family: Calibri;
	font-size: 14px;
	color: #FF9900;
	font-style: italic;
}

.Estilo7 {font-family: Calibri; font-size: 13px; font-style: italic; }
.Estilo14 {font-family: Calibri; font-size: 12px; color: #333333; font-weight: bold; }
.Estilo12 {font-family: Calibri; font-size: 12px; color: #333333; font-style: italic; cursor:pointer; }
-->
</style>
<script type="text/javascript">
$(document).ready(function(){ 

	$("#frmclientes").dialog({height:800, width:740, position :["center","top"],style: "margin:0px; padding:0px; float:none;",  resizable:false,title:'Mant. de Clientes'}); 
		 $("button").button();
		 $("#dialog").dialog();
		 $(".ui-dialog-titlebar").hide();
	
		 fmuestraGrid();
	
		})
	
	$('#btncerrar2').click( function() { alert('das');
		$("#frmclientes").dialog("close");
	});
	
	function muesdatos(){muestragrid();}
	
	function cerrar2(){$("#frmclientes").dialog("close");	}

	function selectidkar(id) { document.getElementById('datos').value = id;	}
	
	function editclie(_obj){
	
		var codclie = document.getElementById('codclie').value; 				 
		var tipop   = document.getElementById('tipop').value; 
		
	$('<iframe id="frame1" class="window-Frame" frameborder="0" src="../controller/editClientCon.php?codclie='+codclie+'&tipop='+tipop+'"/>').dialog({
					autoOpen: true,
					position :["center","top"],
					width   : 720,
					height  : 500,
					modal:false,
					resizable:false,
					title:'Editar Clientes'
					}).width(720).height(500);	
		}
	
	function fShowDetail(obj)
			{
				var _id = obj.cells[0].innerHTML;
				var _gridView = document.getElementById('gridClientes');
				var _rows  = _gridView.rows.length;
				for(i=1;i<=_rows-1;i++)
					{
						if(i%2==0)
							{
								_gridView.rows[i].style.backgroundColor = '#FFFFFF';
							}
						else
							{
								_gridView.rows[i].style.backgroundColor = '#E8E8E8';
							}
					}
				obj.style.backgroundColor = '#b4b4b4'; 
				
				var fil=obj.id;
				document.getElementById('txtfilas').value=fil;
	
					_datos =  $GridData(obj);
					document.getElementById('tipop').value = _datos[2];
					document.getElementById('codclie').value = _datos[0];
	
			}
	
	function agregar(){
	$('<iframe id="frame1" class="window-Frame" frameborder="0" src="../controller/newClientCon.php"/>').dialog({
					autoOpen: true,
					position :["center","top"],
					width   : 700,
					height  : 650,
					modal:false,
					resizable:false,
					title:'Nuevo Cliente'
					}).width(700).height(650);	
		}

	function focusSearch(evento){if(evento.keyCode==13){document.getElementById('Buscar').focus();}} 
	
	function frefresh(){ window.location.reload();}

	function fbusca(_val)
	{
		var combo = document.getElementById('tippersona').value;
		if(combo == "")
		{alert('Seleccione tipo de persona')}
	
		$("#dgrid_kardex").load('list_clientes.php' ,	{_epublic  : combo,	val  : _val	}, function(){
			$('#gridClientes').scrollableFixedHeaderTable(700,500,null,null);
			});
	}	

	function fmuestraGrid()
	{
		var _ini="ini";
		$("#dgrid_kardex").load('list_clientes.php',{_epublic  : _ini }, function(){
			$('#gridClientes').scrollableFixedHeaderTable(700,500,null,null);
			});
	}	

		
</script>
</head>

<body style=" font-size:63.5%;">
<div id="frmclientes">
<form id="frmprotocolares" name="frmprotocolares" method="post" action="actualizar_kardex.php">
<table id="title_client" width="100%" bgcolor="#264965" bordercolor="#264965" cellpadding="0" cellspacing="0">
 <tr>
<td width="36" height="28" align="center" bgcolor="#264965"><img src="../../iconos/nuevo2.png" width="20" height="22" /></td>
              <td width="745" bgcolor="#264965"><span class="submenutitu">Mantenimiento de Clientes</span></td>
              <td width="28" bgcolor="#264965"><a  onClick="cerrar2()" id="btncerrar" href="#"><img id="btncerrar" src="../../iconos/cerrar.png" width="21" height="20" border="0" /></a></td>
            </tr>
            <tr></tr>
</table>

  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="19">
      				  <input name="tipop" id="tipop" type="hidden" />
      				  <input name="datos" id="datos" type="hidden" />
      				  <input name="codclie" id="codclie" type="hidden" />
      				  <input name="tipkar" id="tipkar" type="hidden" />
                      <input name="nomtipkar" id="nomtipkar" type="hidden" />
                      <input name="txtbuscar" id="txtbuscar" type="hidden" />
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
	<td>
    
    <input type="hidden" id="txtfilas" name="txtfilas" value="" />
            <table width="710" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><span class="Estilo7">
                <?php
				$oBarra->Nuevo        = "1"           	  ; 
				$oBarra->NuevoClick   = "agregar();"   	  ; 
				//$oBarra->refresh      = "1"          	  ;
				//$oBarra->refreshClick = "frefresh();"     ;
				$oBarra->clase        = "css"      		  ; 
				$oBarra->Show()  						  ; 
				?>
                </span></td>
                </tr>
                <tr>
          <td width="164"><span class="titubuskar0">
           <select name="tippersona" id="tippersona" style="font-size:12px;">
            <option value ="" selected="selected">TIPO DE PERSONA</option>
            <option value="N">Natural</option>
            <option value="J">Jurídica</option>
          </select>
          </span></td>
        
          <td width="100" align="right" style="font-size:12px;"><span class="titubuskar0"> DESCRIPCION: </span> </td>
          <td width="142"><input  name="descrio" type="text" id="descrio" size="20"  onKeyUp="fbusca(this.value)"/></td>
          <td width="428">&nbsp;</td>
          
</tr>
  	
            </table>
                   
    </td>
</tr>
<tr><td  width="790" height="19" valign="top">
<div id="dgrid_kardex" style="width:705px; height:570px; overflow:auto;">

</div></td>
        </tr>
   </table>

  
  </table>
  </form>
</div>
<script language="javascript">
	$(document).ready(function(){
		
			
		});  
</script>		
</body>
</html>
